home *** CD-ROM | disk | FTP | other *** search
/ Delphi Programmer's Power Pack / Delphi Volume 1.iso / s_to_z / winmac32 / readmewm.txt < prev    next >
Text File  |  1996-09-15  |  7KB  |  130 lines

  1. WinMac32
  2.  
  3. Delphi Macro Component and DLL Set for Windows.
  4.  
  5. Copyright (c) 1994-1996 Ken Henderson.
  6.  
  7. Here's the 32-bit version of the Winmacro component set and macro engine that
  8. I originally released for Delphi 1.0.  Winmacro 1.x users will remember the
  9. TMacroSet component -- it implements a full-blown macro engine for Windows.
  10. The unit actually defines two other components, as well, TMacroKeyEdit (a
  11. desecendant of TEdit that allows entry of hot keys rather than text) and
  12. TMacroComboBox (a descendant of TComboBox that allows selection from a list
  13. of all available keys).
  14.  
  15. The component set provides much of the functionality of the Windows 3.x Recorder
  16. accessory, but far exceeds it in many ways.  One of the most significant
  17. ways it does this is in its support for "code" macros -- macros that
  18. execute callback routines rather than playback keystrokes.  It also
  19. allows nearly any key on the keyboard to be a hotkey -- it even allows
  20. mouse buttons to serve in that capacity.  And, best of all, it's all
  21. configurable from a simple component that insulates the developer from
  22. the complexities, pitfalls and near-death-experiences of the Windows
  23. journaling facility.
  24.  
  25. Another set of facilities in which you may have an interest is TMacroSet's SendKeys
  26. and AppActivate routines.  These work similarly to their Visual Basic counterparts.
  27. AppActivate makes a named window the current input focus, while SendKeys
  28. sends simulated keyboard input to the current input focus.  Note that, unlike
  29. the 16-bit version of Winmacro, the SendKeys routine in WinMac32 does not require
  30. that the macro engine be initialized before it can be used.  Also, the version
  31. of SendKeys found in WinMac32 supports a second parameter, "Wait" -- a boolean
  32. switch that determines whether the routine waits for the current input focus
  33. to process each simulated keystroke before sending it another.
  34.  
  35. I won't go into all the features -- the comments in the WinMac32 source code
  36. document them well.  There's also a wealth of info on the internals of the engine
  37. and components that you may find interesting.  The source to the components
  38. are in WMacro.pas, the source to the macro engine DLL is in WinMac32.pas.
  39.  
  40. You'll want to check out the included SRecordR (SuperRecorder) program for a demo
  41. of some of the things you can do with the macro facility.
  42.  
  43. I've written the engine in such a way as to make it language independent.  I'll
  44. be releasing the header files required to use it with C/C++ very soon.
  45.  
  46. Delphi Installation
  47.  
  48. 1)  Unzip WinMac32.zip to the directory in which you'd like it to reside.
  49. Either add this directory to your path or copy WinMac32.dll to a directory
  50. that is on your path (e.g., \WINDOWS, \PROGRAM FILES\BORLAND\DELPHI 2.0\BIN, etc.)
  51.  
  52. 2)  Select the Install item from the Delphi 2.0 Component menu.  Click the
  53. Add button and supply the full path to the WMACRO.PAS file that was created
  54. when you unzipped WinMac32.zip.
  55.  
  56. 3)  A new toolbar page called "Macros" is created that contains the three
  57. components comprising Delphi's interface to WinMac32.dll.
  58.  
  59. Special note for running SuperRecorder from under Delphi
  60.  
  61. You'll want to uncheck "Break on exception" in the Tools|Options|Environment
  62. dialog when running SuperRecorder under Delphi.  SuperRecorder enters a
  63. loop that iterates through all the *possible* macro indexes and obtains
  64. the name and hot key for each as it goes. Since macros can be deleted from
  65. the middle of the macros "array" -- the engine does not provide a method
  66. for returning the number of currently allocated macros -- it would be of
  67. very limited use.  Since there is no method of this type available,
  68. programs wishing to list all available macros must loop through the macro list
  69. beginning with index 0 through the maximum number of macros.  Though the maximum
  70. number of macros that you may allocate is limited only by available memory, TMacroSet
  71. surfaces a property, MaxMacroNum, to assist in building macros lists.
  72. Applications that use MaxMacroNum must handle exceptions generated by attempting
  73. to access a macro that has been deactivated or by referring to an index that has not
  74. yet had a macro assigned to it.  SuperRecorder demonstrates how to do this.
  75.  
  76. Limits on use
  77.  
  78. This version of Winmacro has been released as a Shareware product. WinMac32
  79. comes in two flavors: the trial version and the full version.  The trial version
  80. will only run when Delphi is also running.  If you attempt to run an application
  81. that uses TMacroSet or WinMac32 while Delphi 2.0 is not also running, the DLL will
  82. refuse to load and you application will crash.
  83.  
  84. The full version, on the other hand, functions properly regardless of whether
  85. Delphi is also running.  It also includes the complete source code to WinMac32,
  86. as well as the 16-bit version of the product for use with Delphi 1.0.
  87.  
  88. You can obtain the full version by registering.  Since the trial version of the
  89. product is for trying it out only, you can't include it with other applications.
  90. You must register the product if you intend to use it.  To register, send a check
  91. or money order for $45 (in US dollars) to:
  92.  
  93. Ken Henderson
  94. P. O. Box 721368
  95. Oklahoma City, OK 73172-1368
  96.  
  97. Once registered, you'll receive:
  98.  
  99. * the complete source code to WinMac32
  100. * the source code to SendKeys and AppActivate, which can be used independently
  101.   of the macro engine
  102. * the full, non-crippled version of the product
  103. * the 16-bit version of the product for use with Delphi 1.0
  104. * documentation that explains the use of the product
  105. * notification of future updates and upgrades
  106.  
  107. Note that the source code to SendKeys and AppActivate can also be found on the
  108. CD-ROM that accompanies my book, Database Developer's Guide with Delphi 2.0,
  109. available from SAMS Publishing. 
  110.  
  111. You can include the full version of WinMac32 with the applications you write without
  112. royalties or other obigations to me. The only restriction on this is that you may
  113. not include WinMac32 with a programming library of any type without my express
  114. written permission.
  115.  
  116. You can feel free to upload the trial version of WinMac32 to other on-line forums
  117. and ftp sites so long as you do not modify it in any way (this includes adding or
  118. removing files from its ZIP file archive).
  119.  
  120. I'd appreciate any feedback you might have.  Send any comments or
  121. suggestions to (CIS): 74763,2305 (Internet: 74763,2305@compuserve.com).
  122.  
  123. Many thanks to Danny Thorpe of Borland for his help and suggestions.
  124.  
  125.  
  126. Ken Henderson
  127. March 25, 1996
  128.  
  129.  
  130.